﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Jzy.BLL.Mail;
using Jzy.Model;

public partial class WebMail_Download : System.Web.UI.Page
{
    private string MailGuid
    {
        get
        {
            return Request["MailGuid"];
        }
    }
    private string FileName
    {
        get
        {
            return Request["FileName"];
        }
    }
    private int Index
    {
        get
        {
            return int.Parse(Request["Index"]);
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        //WebMailBO mail = new WebMailBO(Jzy.Common.AppSession.UserID);
        //WebMailAccountBO account = new WebMailAccountBO(Jzy.Common.AppSession.UserID);
        //WebMailAccountInfo accountInfo = account.GetDefaultInfo();

        //byte[] content = mail.GetAttachContent(accountInfo, MailGuid, Index);

        //string strFileName = Server.UrlEncode(FileName);
        //Response.AddHeader("Content-Disposition", "attachment; filename=" + strFileName);
        //Response.ContentType = "application/unknown";
        //Response.CacheControl = "public";
        //Response.BinaryWrite(content);
        //Response.End();
    }
}
